package algorithms;

/** 
 * Auxiliar class
 * It is used at selection phase for keeping indexes of pairs to crossover
 * */

public class Pair{
	public int[] pair = new int[2];
	
	public Pair(){
		pair[0] = -1;
		pair[1] = -1;
	}
	public Pair(int a, int b){
		pair[0] = a;
		pair[1] = b;
	}
	
	public boolean equals(int[] e){
		if (e[0] == e[1]							
				/*|| 
			(e[0] == pair[0] && e[1] == pair[1])	||	
			(e[1] == pair[0] && e[0] == pair[1])*/	)
			return true;
		return false;
	}
	
	public void set(int index, int value){
		if(index < pair.length)
			pair[index] = value;
	}
	
	public void printPair(){
		System.out.print("(" + pair[0] + "," + pair[1] + ") ");
	}
}